home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.1 (Developer) [x86]
/
NeXT Step 3.1 Intel dev.cdr.dmg
/
NextDeveloper
/
Makefiles
/
app
/
basicrules.make
< prev
next >
Wrap
Text File
|
1993-04-12
|
6KB
|
174 lines
###############################################################################
# NeXT basicrules.make
# Copyright 1992, NeXT Computer, Inc.
#
# This makefile provides a generically useful set of rules for building
# derived files within the framework of app makefiles.
#
###############################################################################
.SUFFIXES:
.SUFFIXES: .o .p .C .cc .cxx .cpp .c .m .M .s .h .ym .y .lm .l .pswm .psw .mig .def .msg .bproj .subproj .copy .installsrc .writable .clean $(BUNDLE_EXTENSION) .depend .lproj .dbmodel .dbmodela
ALL_CFLAGS = $(CFLAGS) $(PROJ_CFLAGS) -I$(SYM_DIR) $(OTHER_CFLAGS) $(RC_CFLAGS)
# Compilation rules:
.c.o:
$(CC) $(ALL_CFLAGS) -I. -c $< -o $(OFILE_DIR)/$*.o
.m.o:
$(CC) $(ALL_CFLAGS) -I. -c $< -o $(OFILE_DIR)/$*.o
.M.o:
$(CC) -ObjC++ $(ALL_CFLAGS) $(C++CFLAGS) -I. -c $< -o $(OFILE_DIR)/$*.o
.C.o:
$(CC) -ObjC++ $(ALL_CFLAGS) $(C++CFLAGS) -I. -c $< -o $(OFILE_DIR)/$*.o
.cc.o:
$(CC) -ObjC++ $(ALL_CFLAGS) $(C++CFLAGS) -I. -c $< -o $(OFILE_DIR)/$*.o
.cxx.o:
$(CC) -ObjC++ $(ALL_CFLAGS) $(C++CFLAGS) -I. -c $< -o $(OFILE_DIR)/$*.o
.cpp.o:
$(CC) -ObjC++ $(ALL_CFLAGS) $(C++CFLAGS) -I. -c $< -o $(OFILE_DIR)/$*.o
.h.p:
-$(CC) -precomp $(ALL_CFLAGS) $*.h -o $*.p
# Note that because precomps must go in the same directory as the .h
# we may not be able to write the precomp, so use a '-'
# pswrap-related rules:
.psw.h:
$(PSWRAP) $(PSWFLAGS) -a -h $(SYM_DIR)/$*.h -o $(SYM_DIR)/$*.c $*.psw
.psw.c:
$(PSWRAP) $(PSWFLAGS) -a -h $(SYM_DIR)/$*.h -o $(SYM_DIR)/$*.c $*.psw
.psw.o:
$(PSWRAP) $(PSWFLAGS) -a -h $(SYM_DIR)/$*.h -o $(SYM_DIR)/$*.c $*.psw
$(CC) $(ALL_CFLAGS) -c $(SYM_DIR)/$*.c -o $(OFILE_DIR)/$*.o
.pswm.h:
$(PSWRAP) $(PSWFLAGS) -a -h $(SYM_DIR)/$*.h -o $(SYM_DIR)/$*.m $*.pswm
.pswm.m:
$(PSWRAP) $(PSWFLAGS) -a -h $(SYM_DIR)/$*.h -o $(SYM_DIR)/$*.m $*.pswm
.pswm.o:
$(PSWRAP) $(PSWFLAGS) -a -h $(SYM_DIR)/$*.h -o $(SYM_DIR)/$*.m $*.pswm
$(CC) $(ALL_CFLAGS) -c $(SYM_DIR)/$*.m -o $(OFILE_DIR)/$*.o
# yacc and lex-related rules
.y.o:
@(initdir=`pwd`; \
cd $(SYM_DIR); \
cmd="$(YACC) $(YFLAGS) $$initdir/$*.y" ; echo $$cmd; $$cmd ; \
cmd="$(MV) $(MVFLAGS) y.tab.c $*.c" ; echo $$cmd; $$cmd ; \
cmd="$(CP) $(MVFLAGS) y.tab.h $*.h" ; echo $$cmd; $$cmd ; \
cd $$initdir ; \
cmd="$(CC) $(ALL_CFLAGS) -I$$initdir -c $(SYM_DIR)/$*.c -o $(OFILE_DIR)/$*.o" ; \
echo $$cmd ; $$cmd )
.y.c .y.h:
@(initdir=`pwd`; \
cd $(SYM_DIR); \
cmd="$(YACC) $(YFLAGS) $$initdir/$*.y" ; echo $$cmd; $$cmd ; \
cmd="$(MV) $(MVFLAGS) y.tab.c $*.c" ; echo $$cmd; $$cmd ; \
cmd="$(CP) $(MVFLAGS) y.tab.h $*.h" ; echo $$cmd; $$cmd )
.ym.o:
@(initdir=`pwd`; \
cd $(SYM_DIR); \
cmd="$(YACC) $(YFLAGS) $$initdir/$*.ym" ; echo $$cmd; $$cmd ; \
cmd="$(MV) $(MVFLAGS) y.tab.c $*.m" ; echo $$cmd; $$cmd ; \
cmd="$(CP) $(MVFLAGS) y.tab.h $*.h" ; echo $$cmd; $$cmd ; \
cd $$initdir ; \
cmd="$(CC) $(ALL_CFLAGS) -I$$initdir -c $(SYM_DIR)/$*.m -o $(OFILE_DIR)/$*.o" ; \
echo $$cmd ; $$cmd )
.ym.m .ym.h:
@(initdir=`pwd`; \
cd $(SYM_DIR); \
cmd="$(YACC) $(YFLAGS) $$initdir/$*.ym" ; echo $$cmd; $$cmd ; \
cmd="$(MV) $(MVFLAGS) y.tab.c $*.m" ; echo $$cmd; $$cmd ; \
cmd="$(CP) $(MVFLAGS) y.tab.h $*.h" ; echo $$cmd; $$cmd )
.l.o:
@(initdir=`pwd`; \
cd $(SYM_DIR); \
cmd="$(LEX) $(LFLAGS) $$initdir/$*.l" ; echo $$cmd; $$cmd ; \
cmd="$(MV) $(MVFLAGS) lex.yy.c $*.c" ; echo $$cmd; $$cmd ; \
cd $$initdir ; \
cmd="$(CC) $(ALL_CFLAGS) -I$$initdir -c $(SYM_DIR)/$*.c -o $(OFILE_DIR)/$*.o" ; \
echo $$cmd ; $$cmd )
.l.c:
@(initdir=`pwd`; \
cd $(SYM_DIR); \
cmd="$(LEX) $(LFLAGS) $$initdir/$*.l" ; echo $$cmd; $$cmd ; \
cmd="$(MV) $(MVFLAGS) lex.yy.c $*.c" ; echo $$cmd; $$cmd )
.lm.o:
@(initdir=`pwd`; \
cd $(SYM_DIR); \
cmd="$(LEX) $(LFLAGS) $$initdir/$*.lm" ; echo $$cmd; $$cmd ; \
cmd="$(MV) $(MVFLAGS) lex.yy.c $*.m" ; echo $$cmd; $$cmd ; \
cd $$initdir ; \
cmd="$(CC) $(ALL_CFLAGS) -I$$initdir -c $(SYM_DIR)/$*.m -o $(OFILE_DIR)/$*.o" ; \
echo $$cmd ; $$cmd )
.lm.m:
@(initdir=`pwd`; \
cd $(SYM_DIR); \
cmd="$(LEX) $(LFLAGS) $$initdir/$*.lm" ; echo $$cmd; $$cmd ; \
cmd="$(MV) $(MVFLAGS) lex.yy.c $*.m" ; echo $$cmd; $$cmd )
# dbcompiler relate rules:
.dbmodela.dbmodel:
$(DBC) $*.dbmodela $(PRODUCT_ROOT)/$*.dbmodel
# msgwrap-related rules - note that suffix rules will not work because the basename changes and there is no one-to-one mapping from .msg's to .o's.
# msgwrap-related rules
$(MSGDERIVEDMFILES): $(MSGFILES)
@(if [ "$(MSGFILES)" != "" ] ; then \
$(MKDIRS) $(SYM_DIR) ; \
$(CP) $(MSGFILES) $(SYM_DIR) ; \
cd $(SYM_DIR) ; \
for msgfile in $(MSGFILES) ; do \
cmd="$(MSGWRAP) $$msgfile" ; \
echo $$cmd ; $$cmd ; \
done ; \
$(RM) -f $(MSGFILES) ; \
fi)
# mig-related rules - old and should be updated
$(ALLMIGDERIVEDCFILES): $(ALLMIGFILES)
@(if [ "$(ALLMIGFILES)" != "" ] ; then \
$(MKDIRS) $(SYM_DIR) ; \
$(CP) $(ALLMIGFILES) $(SYM_DIR) ; \
cd $(SYM_DIR) ; \
for migfile in $(ALLMIGFILES) ; do \
cmd="$(MIG) $$migfile" ; \
echo $$cmd ; $$cmd ; \
done ; \
$(RM) -f $(ALLMIGFILES) ; \
fi)
# compresshelp-related rules:
$(HELP_STORES): $(HELP_DIRS) $(OTHER_HELP_DIRS)
@(for each in $(HELP_DIRS) $(OTHER_HELP_DIRS) ; do \
if [ -d $$each ] ; then \
$(MKDIRS) $(PRODUCT_ROOT)/$(LANGUAGE).lproj ; \
cmd="$(COMPRESSHELP) $$each -o $(PRODUCT_ROOT)/$$each" ; \
echo $$cmd ; $$cmd ; \
fi; \
done )
# in case the default Help directory does not yet exist
$(HELP_DIRS):
# Nullify .m and .c single suffix rules so Help.c and Help.m can exist
.m :
.c :